load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

wrfoutdir = "/public/users/wrf/wrfout/2012042712/"
filename = wrfoutdir + "wrfout_d01_2012-04-27_12:00:00" + ".nc"
a = addfile(filename,"r")

time = 0
tc = wrf_user_getvar(a,"tc",time)       ; T [C]
p  = wrf_user_getvar(a,"pressure",time) ; total pressure
z  = wrf_user_getvar(a,"z", time)       ; z

; Horizontally interpolate to pressure coordinates ("p")
pressure = 850.   ; 850 hPa
height = 8000  ; 1000m
;tc_plane = wrf_user_intrp3d(tc,z,"h",pressure,0.,False)
tc_plane = wrf_user_intrp3d(tc,z,"h",height,0.,False)
;print(tc_plane(:,:,0))
print(tc(10,:,0))
print(tc_plane(:,50))
